<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="/page" prefix="public"%>
<public:pageControl classPath="app.portalbs.basic.comm.app.AppList"/>
<script>

/* 应用发布 */
function appAuthButton_onclick(grid,page){
	
	Yacon.showModal({
		url: "app/appTree.jsp?commID="+page.element.parameter.commID,
		height: "80%",
		width: "30%",
		close: "appAuthButton_window_close"
	});
	
}

/* 应用窗口关闭后执行 */
function appAuthButton_window_close(windows,page){
	page.find("appGrid").refresh();
}

/* 取消发布 */
function cancleAppAuthButton_onclick(grid,page){
	
	grid.getCheckDataSet();
	 if(grid.getRecordCount() <1){
		 alert("请至少选择一条应用信息!");
		 return ;
	 }
	 var appID = "";
	 while(grid.next()){
		 appID += "," + grid.getFieldValue("PW_APP_ID");
	 }
	 var appIDs = appID.substring(1);
	 /* 在授权授权时弹出一个确认框，只有选择确认才会继续操作 */
	 if(confirm("确定要取消授权吗?")){
		 var sendset = new Yacon.data.DataSet(page);
		
		 sendset.setWhereField("commID",page.element.parameter.commID);
		 sendset.setWhereField("appIDs",appIDs);
		 
		 sendset.switchMessage("delPublish");
		
		 grid.refresh();
		  
	 }
}

</script>